home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / VERSION1.5 / WINPROTO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-27  |  9.4 KB  |  188 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *  WinProto.H : Définitions utilisées par les procédures WindGem.       *
  4.  *                                                                      *
  5.  ************************************************************************/
  6.  
  7. #ifndef __WINPROTO__
  8. #define __WINPROTO__
  9.  
  10. /*-=< Section d'inclusion des fichiers d'entete necessaire >=------------*/
  11. #include <stddef.h>
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include <stdlib.h>
  15. #include <ctype.h>
  16. #include <xgemfast.h>
  17. #include <tosbind.h>
  18. #include <atari.h>                                                                                /* pour KEYTAB */
  19. #include <malloc.h>
  20.  
  21. /*************************************************************************
  22.  * Types des fenetres.                                                   *
  23.  *************************************************************************/
  24. #define WTYPNONE -1                        /* Pas de fenetre                          */
  25. #define WTYPDESK 0                        /* Type special pour la gestion            */
  26. #define WTYPFORM 1                        /* Fenetre de type WindForm                */
  27. #define WTYPGRAP 2                        /* Fenetre image                           */
  28. #define WTYPTEXT 3                        /* Fenetre texte                           */
  29. #define WTYPUSER 4                        /* Fenetre "User Defined"                  */
  30.  
  31. /*************************************************************************
  32.  * Définition des structures utilisées par WindGem.                      *
  33.  *************************************************************************/
  34. typedef struct aide                     /* Structure de l'aide pour les Boutons    */
  35. {
  36.     int     numObj;                                /* Numéro de l'objet pour l'aide           */
  37.     char *txt;                                    /* Texte de l'aide                         */
  38.     struct aide *suiv;                    /* Aide suivante                           */
  39. } AIDE;
  40.  
  41. typedef struct popup                    /* Structure pour objets popup             */
  42. {
  43.     int objet;                                    /* Objet auquel on associe le popup        */
  44.     int popup;                                    /* Numéro de l'arbre d'objet Popup         */
  45.     struct popup *suiv;                    /* Popup suivant                           */
  46. } POPUP;
  47.  
  48. typedef struct                                /* Fenetre formulaire                      */
  49. {
  50.     OBJECT    *adr_form;                    /* adresse du formulaire                   */
  51.     int            offset;                            /* Décalage x et y pour boite "OUTLINED".     */
  52.     int            edit;                                /* 1er champ editable ou BLANK.            */
  53.     int            edit_objc;                    /* Objet éditable courant.                 */
  54.     int            edit_pos;                        /* Position courante du curseur d'édition. */
  55.     AIDE      *aide;                            /* Liste des messages d'aide               */
  56.     POPUP        *popup;                            /* Liste des objets popup                  */
  57.     void        (*fonct)(int evnt);    /* fonction de gestion de la fenetre ou \0 */
  58. } WindForm;
  59.  
  60. typedef struct                                /* Fenetre graphique                       */
  61. {
  62.     MFDB    *img;                                    /* Donnees image                           */
  63.     int        nb_color;                            /* Nombre de couleurs                                             */
  64.     int        full;                                    /* Flag pleine ouverture                   */
  65.     int     wtot;                                    /* Largeur maximale de l'image             */
  66.     int        htot;                                    /* Hauteur maximale de l'image             */
  67.     int        lin;                                    /* 1° ligne pour redraw                    */
  68.     int     col;                                    /* 1° colonne pour redraw                  */
  69. } WindGraph;
  70.  
  71. typedef struct                                /* Fenetre texte                           */
  72. {
  73.     int        type;                                    /* Type de la fenêtre : User ou Auto       */
  74.     char    **lignes;                            /* Contenu de la fenêtre                   */
  75.     int        full;                                    /* Flag de pleine ouverture                */
  76.     int        nbrel;                                /* Nbre de lignes du texte                 */
  77.     int        nbrec;                                /* Nbre de colonnes du texte               */
  78.     int        lin;                                    /* 1° ligne de texte                       */
  79.     int        col;                                    /* 1° colonne de texte                     */
  80. } WindText;
  81.  
  82. #define TYP_TEXT_AUTO 0                /* Le texte vient d'un fichier donné       */
  83. #define TYP_TEXT_USER 1                /* Le texte est fourni par l'utilisateur   */
  84.  
  85. typedef struct                                /* Fenetre Utilisateur                     */
  86. {
  87.     int full;                                        /* Flag pleine ouverture                   */
  88.     void (*init)();                            /* Fonction d'initilisation                */
  89.     void (*exit)();                            /* Fonction de terminaison                 */
  90.                                                             /* Fonction de redessin                    */
  91.     void (*message)(int evnt, int buff[8]);
  92.                                                             /* Fonction de gestion du clavier          */
  93.     void (*clavier)(int kbd, int key);
  94.                                                             /* Fonction de gestion de la souris        */
  95.     void (*souris)(int x, int y, int k, int nb);
  96.     void *var;                                    /* Permet à l'utilisateur de  stocker les  */
  97.                                                             /* var. dont il aura besoin (structure).   */
  98. } WindUser;
  99.  
  100. typedef union cont                        /* Definition du contenu d'une fenetre     */
  101. {
  102.     WindForm    *dialog;                    /* Type boite de dialogue                  */
  103.     WindGraph    *image;                        /* Type fenetre image                      */
  104.     WindText    *text;                        /* Type fenetre texte                      */
  105.     WindUser    *user;                        /* Type fenetre utilisateur                */
  106. } Cont;
  107.  
  108. typedef struct listeFen                /* Liste des fenetres                      */
  109. {
  110.     int        handle;                                /* handle de la fenetre si ouverte         */
  111.     int        numObj;                                /* Numero de la fenetre                    */
  112.     int     type;                                    /* type de la fenetre                      */
  113.     int        attrib;                                /* Attributs de la fenetre                 */
  114.     int        mode;                                    /* fenetre modale ou non                   */
  115.     char    *w_title;                            /* pointeur sur une chaine titre           */
  116.     OBJECT *adr_wmenu;                    /* Objet menu de la fenêtre ou NULL        */
  117.     void    (*wmenu)(int opt);        /* Fonction de gestion du menu en fenêtre  */
  118.     OBJECT *adr_wtoolbar;                /* Objet ToolBar de la fenêtre ou NULL     */
  119.     void    (*wtoolbar)(int opt);    /* Fonction de gestion de la ToolBar       */
  120.     int Xpos, Ypos, Wpos, Hpos;    /* Position courante                                             */
  121.     int        iconified;                        /* Flag iconification                      */
  122.     Cont     cont;                                    /* Contenu de la fenetre                   */
  123. } Wind;
  124.  
  125. #define BARMENU  1                        /* Pour objets menu en fenêtre          */
  126. #define BARTITLE 2
  127.  
  128. #define WINDFORM_NULL        (WindForm *)0
  129. #define WINDGRAPH_NULL    (WindGraph *)0
  130. #define WINDTEXT_NULL        (WindText *)0
  131. #define WINDUSER_NULL        (WindUser *)0
  132. #define WIND_NULL                (Wind *)0
  133.  
  134. #define MD_ATTRIB (NAME|MOVER)
  135. #define FW_ATTRIB    (NAME|CLOSER|MOVER|SMALLER)
  136. #define GW_ATTRIB (NAME|CLOSER|FULLER|MOVER|SMALLER|SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  137. #define TW_ATTRIB (NAME|CLOSER|FULLER|MOVER|SMALLER|SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  138.  
  139. /*************************************************************************
  140.  * Structure systeme.                                                    *
  141.  *************************************************************************/
  142. #define NBWIND    60                        /* Nombre maximum de fenetres              */
  143.  
  144. /*************************************************************************
  145.  * Valeur de definition des objets UserDefs.                             *
  146.  *************************************************************************/
  147. #define UNDER_B 18                /* Pour raccourcis clavier                     */
  148. #define SMALL_B 22                /* Petite écriture                             */
  149. #define POPUP_B 24                /* Boutons PopUp                               */
  150. #define RADIO_B 26                /* Radio-Boutons                               */
  151. #define CHECK_B 28                /* Check-Box                                   */
  152. #define GROUP_B 30                /* Objet Groupe                                */
  153.  
  154. /*************************************************************************
  155.  * Déclaration des variables fournies par WindGem.                       *
  156.  *************************************************************************/
  157. extern int buff[8];                        /* Buffer evenement                        */
  158. extern System *Sys;                        /* Variable Systeme                        */
  159. extern Wind LstFen[NBWIND];        /* Liste des fenetres (60 fenetres max.)   */
  160. extern DTA dtabuffer;                    /* Tampon DTA                              */
  161. extern char ErrMessageNoWind[128];/* Message d'erreur                        */
  162. /*************************************************************************
  163.  * Prototypes des Fonctions de Internes à WindGem.                       *
  164.  *************************************************************************/
  165. extern int IsPopup (Wind *wind, int objet);
  166. void PopupNextValeur (int arbre, int obj, int popup);
  167.  
  168. extern void    RecaleWind(Wind *wind);
  169. extern void AjouteListe(int type, int attrib, int numObj, int mode, char *title, GRECT pos, void *ptr_var);
  170. extern Wind *ObjListe(int numObj);
  171. extern Wind *TopListe(int handle);
  172. extern void WindTextDo (Wind *wind, int evnt);
  173. extern void WindTextSliders (Wind *wind);
  174. extern void WindUserDo(Wind *wind, int evnt);
  175. extern int stdkey (unsigned char *k);
  176. extern int parent (OBJECT *adr, int object);
  177. extern int m_title (OBJECT *adresse, int option);
  178. extern void DrawIcone (int handle, GRECT *zone);
  179. extern void AfficheAide (Wind *wind, int objet);
  180. extern void menu_wind (Wind *wind, int ob);
  181. extern void fill_tab (int *pxy, int n, ...);
  182.  
  183. #endif
  184.  
  185. /*************************************************************************
  186.  * Fin du module de declaration.                                         *
  187.  *************************************************************************/
  188.